﻿<UserControl x:Class="TelecoSystems.Modules.Products.Views.EditVariantView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
    xmlns:cmd="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"
    x:Name="EditVariantViewControl"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:TelecoSystems.Web.Models;assembly=TelecoSystems" xmlns:my1="clr-namespace:TelecoSystems.Web.Services.Variants;assembly=TelecoSystems" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit">
    <Grid x:Name="LayoutRoot">
    	<Grid.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="#FFDDE8ED"/>
    			<GradientStop Color="#FF596A72" Offset="1"/>
    		</LinearGradientBrush>
    	</Grid.Background>
        <Grid HorizontalAlignment="Left" Name="DetailForm" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <sdk:Label Content="Name:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="nameTextBox" Text="{Binding Path=VariantDetail.Name, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True, TargetNullValue=''}" VerticalAlignment="Center" Width="200" />
            <sdk:Label Content="Description:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Top" />
            <TextBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Margin="3" TextWrapping="Wrap" Height="60" Name="descriptionTextBox" Text="{Binding Path=VariantDetail.Description, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True, TargetNullValue=''}" VerticalAlignment="Center" Width="200" />
            <sdk:Label Content="Price:" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="3" Name="priceTextBox" Text="{Binding Path=VariantDetail.Price, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}" VerticalAlignment="Center" Width="200" />
            <sdk:Label Content="Is In Sale:" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <CheckBox Content="" Grid.Column="1" Grid.Row="3" Height="16" HorizontalAlignment="Left" IsChecked="{Binding Path=VariantDetail.IsInSale, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}" Margin="3" Name="isInSaleCheckBox" VerticalAlignment="Center" />
            <sdk:Label  Grid.Column="0" Grid.Row="4" Content="Target group:" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <ComboBox  Grid.Column="1" Grid.Row="4" x:Name="TargetGroupsComboBox" Width="160" HorizontalAlignment="Left"  ItemsSource="{Binding Path=TargetGroups}" SelectedItem="{Binding Path=VariantDetail.TargetGroup, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Path=Name}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <sdk:Label Content="Created:" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <sdk:DatePicker Grid.Column="1" Grid.Row="5" IsEnabled="False" HorizontalAlignment="Left" Margin="3" Name="dateCreatedDatePicker" SelectedDate="{Binding Path=VariantDetail.DateCreated}" VerticalAlignment="Center" />
            <sdk:Label Content="Modified:" Grid.Column="0" Grid.Row="6" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <sdk:DatePicker Grid.Column="1" Grid.Row="6" IsEnabled="False" HorizontalAlignment="Left" Margin="3" Name="dateLastModifiedDatePicker" SelectedDate="{Binding Path=VariantDetail.DateLastModified}" VerticalAlignment="Center" />
            <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="7" Orientation="Horizontal" Margin="0,10,0,10" HorizontalAlignment="Right">
                <Button cmd:Click.Command="{Binding SubmitCommand}" Content="OK" Width="80" Margin="0,0,20,0" x:Name="OKButton" />
                <Button cmd:Click.Command="{Binding CancelCommand}" Content="Cancel" Width="80" x:Name="CancelButton" />
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
